package com.md.service;

import com.md.entity.Flowers;
import com.md.mapper.flowerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class flowerSeriveImpl implements flowerService {
    @Autowired
    private flowerMapper flowerMapper;
    @Override
    public List<Flowers> selectAll() {
        return flowerMapper.selectAll();
    }

    @Override
    public Flowers selectOneById(int id) {
        return flowerMapper.selectOneById(id);
    }

    @Override
    public List<Flowers> selectOneByName(String name) {
        return flowerMapper.selectOneByName(name);
    }

    @Override
    public Boolean insert(Flowers flowers) {
        return flowerMapper.insert(flowers)>0;
    }

    @Override
    public Boolean delete(int id) {
        return flowerMapper.delete(id)>0;
    }

    @Override
    public Boolean update(Flowers flowers) {
        System.out.println(flowers);
        return flowerMapper.update(flowers)>0;
    }
}
